<script lang="ts" setup>
import { ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router'
const router = useRouter()
const open = () => {
    ElMessageBox.alert('找不到这个页面', '404', {
        // if you want to disable its autofocus
        // autofocus: false,
        confirmButtonText: '请前往主页',
        callback: () => {
            router.push('/layout/main')
        },
    })
}
open()
</script>
<template>
    <el-button plain @click="open">Click to open Message Box</el-button>
</template>
<style scoped></style>